package com.wang.service.impl;

import com.wang.dto.DemoVo;
import com.wang.dto.Pojo;
import com.wang.generator.dao.StudentMapper;
import com.wang.generator.entity.Student;
import com.wang.service.IDemoService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

@Service(interfaceClass = IDemoService.class,group = "dev",version = "1.0.0",timeout = 500)
public class DemoServiceImpl implements IDemoService {

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public String getMsg(String param){
        try {
            Thread.sleep(100);
        }catch (Exception e){}
        Student student = studentMapper.selectByPrimaryKey(1);

        Student student2 = studentMapper.selectByPrimaryKey(2);
        System.out.println(student);
        return param + "from server";
    }

    @Override
    public String testPojo(Pojo pojo) {
        return pojo.getId() + " "+pojo.getName();
    }

    @Override
    public String testS(DemoVo demoVo) {
        return "123456";
    }
}
